package com.hg.oa.module.mine.layer;

import android.os.Bundle;
import android.transition.Explode;
import android.transition.Transition;

import com.hg.oa.R;
import com.hg.oa.common.BaseActivityWithToolBar;
import com.hg.oa.widget.DownloadDialog;

import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by fengxiang on 2016/9/18.
 */
public class SettingActivity extends BaseActivityWithToolBar {

    Unbinder unbinder;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        unbinder = ButterKnife.bind(this);
        setTitle("设置");
        setBtnLeft1Enable(true);
        setupWindowAnimations();
    }

    //默认关闭当前activity
    protected void onBtnLeft1Click() {
        finishAfterTransition();
    }

    @OnClick(R.id.btn_update)
    void update(){
        DownloadDialog downloadDialog = new DownloadDialog(this);
        downloadDialog.show();
    }


    private void setupWindowAnimations() {
        Transition transition = buildEnterTransition();
        getWindow().setEnterTransition(transition);
    }

    private Transition buildEnterTransition() {
        //explode 动画方式 从上往下掉的感觉
        Explode enterTransition = new Explode();
        enterTransition.setDuration(getResources().getInteger(R.integer.anim_duration_long));
        return enterTransition;

    }
}
